package com.daodway.designpattern.singletonpattern;

public class SingletonHungry {
	/*单例模式中所有对象公用属性*/
	 private String name = null; 
	 /*饿汉式创建单例*/
	  private static SingletonHungry instance=new SingletonHungry();
	  
	  private SingletonHungry(){}
	  
	  public static SingletonHungry getInstance() {
	      return instance;
	  }

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	  
	  
}
